<h2>Thư viện ảnh</h2>

<a class="custom" href="<?php echo '?action=add'; ?>">Thêm</a><a class="custom" href="javascript: history.go(-1);" >Trở lại</a>
<table class="employees" border="0">
    <tr>
        <!--<th><input type="checkbox" name="" id="checkAll" onclick="checkAll();" value="" /></th>-->
        <th>ID</th>
        <th>Image</th>
        <th>Pro Id</th>
        <th>Action</th>
    </tr>
    <?php
    $img = new Admin_Models_Image();
    foreach ($this->listImages as $img) {
        ?>
        <tr class="emp">
            <!--<td class="cell"><input type="checkbox" name="checkOne[]" value="<?php echo $img->getImgId(); ?>" /></td>-->
            <td class="cell"><?php echo $img->getImgId(); ?></td>
            <td class="cell"><img src="<?php echo URL_BASE . DS . $img->getUrl(); ?>" style="width: 100px; height: 60px;" /></td>
            <td class="cell"><?php echo $img->getProId(); ?></td>
            <td class="cell"><a href="<?php echo URL_BASE . '/admin/product/delImage/' . $img->getImgId() . '?pro_id=' . $img->getProId(); ?>" onclick="confirm('Bạn có chắc chắn muốn xóa không?');">Xóa</a></td>
        </tr>
        <?php
    }
    ?>
</table>

<?php
if (isset($_GET['action']) && $_GET['action'] == 'add') {
    ?>
    <form name="" action="<?php echo URL_BASE; ?>/admin/product/addImages/<?php echo $this->proId; ?>" method="post" id="cat" class="frm" enctype="multipart/form-data">
        <p>
            <label>Images:</label>
            <input type="file" name="fImages[]" id="" multiple />
        </p>
        <p>
            <label></label>
            <input type="submit" name="btnAdd" value="Thêm" />
        </p>
    </form>
    <?php
}
?>